View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000987 | K18X001.00 SKB SWAN | SW | public | 2020-10-19 18:17 | 2021-03-03 12:35 |
| Reporter | Assigned To | (ALTech) Wooshin Kang | Due Date | ||
| Priority | normal | Severity | s3-moderate | Reproducibility | have not tried |
| Status | closed | Resolution | fixed | ||
| Summary | 0000987: [SWAN] AUX input implementation | ||||
| Description | Hi Wooshin, We have some questions about the AUX input detection and switching. We assume we will be in charge of Aux input detection. 1.Do we need to inform SKT about the Aux input being switched to feed data to CPU ? We ask this questions because it can only have one of reference audio or AUX input to feed I2S data to CPU at the same time. If AUX is switched to feed audio data to CPU, the reference audio capture will capture data from AUX. It can not be used for FFV audio processing. 2.What situation we need to switch AUX to feed data to CPU? For example, if the Karaoke App is using Karaoke MIC then we detect AUX input, do we need to switch to AUX input immediately? | ||||
| Additional Information | Currently, CPU I2S input 0 is connected to a switch. The switch will select one of I2S data from reference or TI ADC. TI ADC has two inputs: one is AUX input and the other one is Karaoke MIC. And it can be activated one at the same time as I know . | ||||
| Tags | No tags attached. | ||||
| Attach Tags | |||||
| User List |
(HW) Sean Chiang , (HW) Tom Lee , (SW) Sam Yang |
|---|
|
|
Dear River, I ask to sptek about it, if get response from them, i will share. thanks. |
|
|
Hi Wooshin, We are working on audio routing implementation and do you have update on this ? |
|
|
Dear Jacky, I am sorry, I have already add comment on other ticket. Please check below link. https://docs.google.com/spreadsheets/d/1-CWjjU_kpAeYXLra9OGdqnP80IV6anFGh1NJCGKiPx8/edit?usp=sharing Thanks. |
|
|
Hi Wooshin, There is only sentence in the link for AUX: "Automatically change path to AUX IN usingH/W detection" So, does this mean that we detect AUX iN and then we automatically switch to AUX IN? AUX audio will be removed after AUX plug out? If so, then the Karaoke App will not have MIC input after AUX IN is plugged. Does customer want this behavior? |
|
|
Dear River, "So, does this mean that we detect AUX iN and then we automatically switch to AUX IN? AUX audio will be removed after AUX plug out?" >> Yes, audio path will be changed automatically. Priority of Aux input is top, if it is detected aux input, it should be selected for output. If so, then the Karaoke App will not have MIC input after AUX IN is plugged. Does customer want this behavior? >> Karaoke app controls external mic input itself using BTF HAL, so you know when ext mic should be enabled or disabled. If mic is enabled even though no connected ext mic, aux input should be disable. If you have any question about my answer, please inform us. Thanks. |
|
|
BT sink/Aux in is still under development. 1) Add code to Aux input auto detection to route AUX in audio to Synaptics SND module. AUX IN is not able to be opened by the latest image. We opened Synaptics Jira67 to ask Synaptics to fix it. Synaptics will give patch by 11/25. We can now detect Aux input. Need to add code for switch AUX/Karaoke MIC input. 2) Mute BT sink when AUX input is plugged. |
|
|
Hi Wooshin, Currently, there is a problem that the tinyalsa device of 6ch reference+FFV and tinyalsa device of AUX-in/Karaoke-MIC can not be open at the same time. This is the issue we raised in the Synaptics Jira 67. But we get information from Synaptics, it is a limitation. So there is only one task between NUGU preprocessing task and AUX-in/Karaoke-MIC task can open tinyalsa device. It means that NUGU preprocessing task needs to close the already opened tinyalsa device when AUX-in/Karaoke MIC wants to use it. And when AUX-in/Karaoke-MIC does not need to use it, NUGU preprocessing task can open it again. So, we need a way to communicate with NUGU preprocessing task when to close the tinyalsa device and when they can open it. If SKT wants to define the communication method, we can follow their method. If SKT does not have any idea to define the communication method, the following is our proposal. We define two properties to communicate: 1.Property "vendor.audio.skb.i2s0_owner_is" : Set by NUGU preprocessing task and check by AUX-in/Karaoke-MIC task. It has values of "NUGU" "KARAOKE" "AUX". "NUGU": Set by NUGU preprocessing task when the tinyalsa devices is opened by NUGU preprocessing task. "KARAOKE" or "AUX": Set by NUGU preprocessing task when tinyalsa device is closed by NUGU preprocessing task. 2.Property "vendor.audio.skb.i2s0_owner_to_be" : Set by AUX in/Karakoke task and check by NUGU preprocessing task. It has values of "NUGU" "KARAOKE" "AUX". "KARAOKE" or "AUX": AUX-in/Karaoke-MIC task wants to use tinyalsa device. NUGU preprocessing task should check this and close the tinyalsa device. "NUGU" : AUX-in/Karaoke-MIC task does not need to use tinyalsa device. NUGU preprocessing task can open it again. Please let us know if SKT wants to use their own communication method or our proposal? |
|
|
Hi Wooshin, Do you have any update about the comment I wrote in 5162? It will affect the Karaoke MIC implementation and AUX in Audio Routing schedule. |
|
|
Dear River, I am discussing it with SKT and if any update i will inform you. Thanks. |
|
|
Hi River, Currently, skt manager is working to make as your comment and we need one more option, We have to consider scenario that nugu can get resource by itself because priority of nugu call is higher than aux or karaoke. Is it possible to make scenario using "AUX", "NUGU" "KARAOKE" "NUGUCALL" ? And skt manager wants initial value of "vendor.audio.skb.i2s0_owner_is" and "vendor.audio.skb.i2s0_owner_to_be" to be NUGU. Thanks. |
|
|
Hi Wooshin, Is it possible to make scenario using "AUX", "NUGU" "KARAOKE" "NUGUCALL" ? >>It is possible. Then we will check if the NUGUCALL is set, we will release the opened device. And the default of "vendor.audio.skb.i2s0_owner_is" and "vendor.audio.skb.i2s0_owner_to_be" will be NUGU. |
|
|
Hi River, Please implement as previous discussion ( 5162 ~ 5231). Thanks. |
|
|
Hi Wooshin, Thanks your help. We will follow ( 5162 ~ 5231) to implement it. |
|
|
Hi River, SKT already have implemented it and commit. Please update your status. And following is his comment. When he dose test from AUX to NUGU, he sometime have gotten error when handle of pcm open. "12-02 09:00:30.651 328 688 E audio_hw_AudioStreamNUGUPPIn: NUGUPPCore::openDevice() Cannot open pcm device for mics with requested config(cannot set sw params: Invalid argument)" After error happen once, pcm_open() is always fail. If i restart audioserver, pcm_open, pcm_close is ok. Please check it in kernel area. |
|
|
Hi Wooshin, We encounter an issue that audio has some gap in playing AUX-in audio. So, we are debugging it. For SKT'issue, it seems is a issue that doing pcm_open() and pcm_close many times will cause problem. We will look into this issue after the audio gap issue is fixed. |
|
|
Hi Wooshin, Regarding the issue that SKT reported in 0000987:0005267: ============================================================================= When he dose test from AUX to NUGU, he sometime have gotten error when handle of pcm open. "12-02 09:00:30.651 328 688 E audio_hw_AudioStreamNUGUPPIn: NUGUPPCore::openDevice() Cannot open pcm device for mics with requested config(cannot set sw params: Invalid argument)" ============================================================================= I think it is a SKT's bug. They do not properly initialized the configuration data for pcm_open(). I change their code to fix it in the following commit. commit 526527df4a14bcbcbfefbe62d74bca5adf48374a Author: river wong <river.wong@fii-foxconn.com> Date: Fri Dec 4 14:54:24 2020 +0800 Fix pcm_open sometimes failed by invalid sw params. |
|
|
Hi, River I will inform him about it. Thanks. |
|
|
Hi Wooshin, About the property, I check the SKT's implementation in vendor\synaptics\vsxxx\audio\AudioStreamNUGUPPIn.cpp. I think they misunderstand my description in 0000987:0005162 about how to use the properties. In their implementation, they also set property "vendor.audio.skb.i2s0_owner_to_be" which should only be set by us. If two threads are setting a shared property, there will be a synchronization issue. (For example, one may overwrite the other's value without notice because no lock mechanism). That's why I mentioned in 0000987:0005162, "i2s0_owner_to_be" property is only set by our task and only check by SKT NUGU preprocessing task. And "i2s0_owner_is" property is only set by SKT NUGU preprocessing task and check by our task. I give a example in attached ppt file. Please share it to SKT. If they have any concern or better idea, please lets us know. |
|
|
Hi river, He want know when overwrite occur and he think currunt code has not problem. How can I explain more detaily him ? Without source code, explanation is very difficult for me. And, Please review my sample code. thanks. aux_4ch_selection.txt (3,124 bytes)
Aux_thread()
{
while(1)
{
boolean pcm_handle_opened = 0;
if (Aux_detected == 1)
{
/* Aux가 핸들을 가지고 있을 경우*/
if (vendor.audio.skb.i2s0_owner_is == AUX)
{
if(vendor.audio.skb.i2s0_owner_to_be == NUGUCALL)
{
if (pcm_handle_opened)
{
pcm_close();
pcm_handle_opened = 0;
vendor.audio.skb.i2s0_owner_is = NUGUCALL;
}
}
else if(vendor.audio.skb.i2s0_owner_to_be == AUX)
{
if(!pcm_handle_opened)
{
pcm_handle_opened = 1;
pcm_open()
}
}
sleep(1000);
}
else
{
if (vendor.audio.skb.i2s0_owner_is == NUGUCALL)
{
print("can't get handle because of NUGUCALL);
}
else if (vendor.audio.skb.i2s0_owner_is == NUGU)
{
if (vendor.audio.skb.i2s0_owner_to_be != AUX)
{
vendor.audio.skb.i2s0_owner_to_be = AUX;
}
}
sleep(1000);
}
}
else
{
if(pcm_handle_opened)
{
vendor.audio.skb.i2s0_owner_to_be = NUGU;
vendor.audio.skb.i2s0_owner_is = NUGU;
}
}
}
}
NUGU_thread()
{
boolean nugucall_detect = 0, pcm_handle_opened = 1;
while()
{
if (nugucall_detect == 1)
{
/* handle 필요 */
if (vendor.audio.skb.i2s0_owner_is == NUGU || endor.audio.skb.i2s0_owner_is == NUGUCALL)
{
if(pcm_handle_opened == 0)
{
pcm_handle_opened = 1;
pcm_open();
}
}
else
{
vendor.audio.skb.i2s0_owner_to_be = NUGUCALL;
}
sleep(1000);
}
else
{
if(vendor.audio.skb.i2s0_owner_to_be != NUGU) /* AUX 또는 KARAOKE 가 handle 요구 */
{
if (pcm_handle_opened)
{
pcm_close();
pcm_handle_opened = 0;
}
vendor.audio.skb.i2s0_owner_is = vendor.audio.skb.i2s0_owner_to_be;
}
else
{
if(vendor.audio.skb.i2s0_owner_is == NUGU)
{
if (!pcm_handle_opened)
{
pcm_open();
pcm_handle_opened = 1;
}
}
}
}
}
} |
|
|
Hi Wooshin, I attached a ppt file to explain a synchronization issue if two threads are trying to set one property. In the case, AUX is plugged and NUGUCALL is coming at the same time. You can see the final result is that the property set to AUX. But the right result should be NUGUCALL. If one property is checked and set by two threads at the same time, it will has this kind of issue. I think this will cause bug sometime. So it should be used like this way. |
|
|
Hi River, Please check attached file, following are opinion of SKT Manager. "If you think your idea is better than now after reading attached document, he will change his code. But property name should be changed because "Readability" is not good." |
|
|
Hi Wooshin, Even in SKT ppt file, I think it will still have some potential issue if AUX is set to "i2s0_owner_to_be" just before NUGUCALL is set to "i2s0_owner_is" by next 200ms check. Then the pcm device will be occupied by AUX. So, I think SKT should change their code. I agree the property name should be changed. But I does not have any good naming idea. If SKT has good naming idea, I will follow their naming. I attach more examples in ppt file for SKT's reference. |
|
|
For commit comment... https://jira.skbroadband.com/projects/BTVSBOX/issues/BTVSBOX-362?filter=myopenissues |
|
|
Hi Wooshin, FYI. I test SKT's new property change commit. It looks good. But in my test case, I can only test switch between AUX, KARAOKE and NUGU. NUGUCALL is not tested. |
|
|
Hi River, When will you commit for aux and karaoke ?, It should be tested by SKB QA, SKB QA will finish at next tuseday. Thanks, |
|
|
Hi Wooshin, I will commit code later today. But there are still some known issues. I will list known issues later after I commit it. |
|
|
Hi Wooshin, I commit to code that support AUX-IN and Karaoke code to bitbucket. There are some known issues for AUX-IN and Karaoke: 1.Sometimes there are audio noises (a short noise) when AUX-in and Karaoke is playing. We think it is Synaptics's bug. So we report to Synaptics jira 75 "Audio gap in I2S ouput". 2.BTV audio has a lot of noises when AUX-in is plugged. We think it is Synaptics's bug. So we report to Synaptics jira 85. 3.Karaoke input sometimes has a non-stop noise when unplug then plug. We are coworking with TI FAE now. 4.Karaoke echo level is not adjustable now. Sam is working on this issue. |
|
|
When i run karaoke app( ex TJ노래방 ), there is white noise regardless of karaoke mic's unplug/plug. Who would fix it.? please comment. < no noise > 12-23 18:16:57.919 462 2323 I hal_mic : HAL_MicSetOnOff, 1301, in, v.102, MIC status on 12-23 18:16:57.919 462 2323 I hal_mic : HAL_MicSetOnOff, 1311, out, return HAL_OK <noise> 12-23 18:17:42.243 462 2323 I hal_mic : HAL_MicSetOnOff, 1301, in, v.102, MIC status off 12-23 18:17:42.243 462 2323 I hal_mic : HAL_MicSetOnOff, 1311, out, return HAL_OK <no noise> |
|
|
Hi Wooshin, Please discuss Karaoke issue in https://172.18.223.170/vaas/view.php?id=1030. I think it will be more easy to track issue. |
|
|
Hi Wooshin, I think this issue is a little bit related to HW design and could you kindly help to create a new ticket and I will ask HW leader Sean to join discussion? |
|
|
Hi jacky, I will inform it to our h/w engineer. Thanks. |
|
|
Any update..? |
|
|
Hi Wooshin, We already had committed the code which would mute Karaoke input if Karaoke MIC plug is not detected. (mantis: 1030) Regarding white noise issue, we think the white noise level in SWAN is nearly equal to AI2. The major difference is that the default audio output SWAN is internal speaker but it’s HDMI in AI2. White noise is also being amplified through internal AMP so it’s more sensible by human ear. I think we have Sean to explain this from HW point of view. Hi Sean, Please help to explain it in detail. |
|
|
Hi Sean, Please explain about white noise. Thanks. |
|
|
Hi Wooshin, As per River mentioned, the default audio output of SWAN is speakers instead of HDMI output. And the MICs signal output to speakers will be amplified by audio AMP IC. Therefore, the white noise will be more easy to be heard. However, the SNR performance of woofer AMP is 91.3 dB at AMP maximum power and the mid. range amplifier is 86.3 dB which should be sufficient for the AMP ICs circuitry design. Therefore, based on the current design, I think the best way to solve the white noise problem is to reduce the default volume when inserting the MIC plug and opening the APP, but we still need ALT to confirm the default volume that should be set now. Please check it and let us know your thought. Thanks! Reagrds, Sean |
|
|
Hi Sean, Thanks for your explanation. I understand fully. I need special image for adjusting volume level of MIC and i will decide which level is good for us. Hi Sam, Please make some function for it. |
|
|
Hi, Wooshin https://drive.google.com/file/d/1DKVOaFsx8x5Sb00oC2hZh_ZXS4hKZjWZ/view?usp=sharing please use this FW image to tune volume level. (you can also use any FW at code base from 20210127 18:00) manual: su setenforce 0 getenforce mkdir /data/mic_config echo "10" > /data/mic_config/mic_volume.txt chmod 666 /data/mic_config/mic_volume.txt cat /data/mic_config/mic_volume.txt , and enter test APP: tj, ... again (you can change 0~100 volume value and echo to /data/mic_config/mic_volume.txt) If any problem, please let me know, thanks~ |
|
|
HI sam, Thanks for image. |
|
|
Hi, Wooshin If you confirm an appropriate default MIC volume value, please feedback. THX. |
|
|
Hi Sam, Owner of Mic volume value is lonnie who is h/w engineer. I will check him. @lonnie, Please share result of your test. Thanks |
|
|
Hi sam, Please set to 50. Thanks. |
|
|
Hi Wooshin, Already apply it, please use the FW image of the code base after 20210209 15:46. THX. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2020-10-19 18:17 |
|
New Issue | |
| 2020-10-19 18:17 |
|
Status | new => assigned |
| 2020-10-19 18:17 |
|
Assigned To | => (ALTech) Wooshin Kang |
| 2020-10-20 09:32 | (ALTech) Wooshin Kang | Note Added: 0004666 | |
| 2020-10-26 12:13 | (SW) Jacky Chiang | Note Added: 0004735 | |
| 2020-10-26 12:14 | (SW) Jacky Chiang | Note Edited: 0004735 | |
| 2020-10-26 12:39 | (ALTech) Wooshin Kang | Note Added: 0004736 | |
| 2020-10-26 12:41 | (ALTech) Wooshin Kang | Assigned To | (ALTech) Wooshin Kang => (SW) River Wong |
| 2020-10-28 09:19 |
|
Note Added: 0004765 | |
| 2020-10-28 10:08 | (ALTech) Wooshin Kang | Note Added: 0004768 | |
| 2020-11-13 11:11 | (SW) Jacky Chiang | Project | T99X171.00 SKB Eagle => K18X001.00 SKB SWAN |
| 2020-11-24 09:00 |
|
Note Added: 0005119 | |
| 2020-11-26 09:19 |
|
Note Added: 0005162 | |
| 2020-11-29 20:49 | (SW) Jacky Chiang | Assigned To | (SW) River Wong => (ALTech) Wooshin Kang |
| 2020-11-29 20:49 | (SW) Jacky Chiang | Status | assigned => feedback |
| 2020-11-30 13:53 |
|
Note Added: 0005216 | |
| 2020-11-30 13:53 |
|
Status | feedback => assigned |
| 2020-11-30 14:56 | (ALTech) Wooshin Kang | Note Added: 0005218 | |
| 2020-11-30 17:12 | (ALTech) Wooshin Kang | Note Added: 0005227 | |
| 2020-11-30 20:13 |
|
Note Added: 0005231 | |
| 2020-12-01 09:23 | (ALTech) Wooshin Kang | Note Added: 0005233 | |
| 2020-12-01 11:08 |
|
Note Added: 0005238 | |
| 2020-12-03 09:12 | (ALTech) Wooshin Kang | Note Added: 0005267 | |
| 2020-12-03 09:12 | (ALTech) Wooshin Kang | Note Edited: 0005267 | |
| 2020-12-03 09:57 | (SW) Jacky Chiang | Assigned To | (ALTech) Wooshin Kang => (SW) River Wong |
| 2020-12-03 14:28 |
|
Note Added: 0005286 | |
| 2020-12-04 15:00 |
|
Note Added: 0005308 | |
| 2020-12-04 15:48 | (ALTech) Wooshin Kang | Note Added: 0005310 | |
| 2020-12-08 15:09 |
|
File Added: property_usage_example.pptx | |
| 2020-12-08 15:09 |
|
Note Added: 0005346 | |
| 2020-12-08 15:10 |
|
Note Edited: 0005346 | |
| 2020-12-08 16:56 | (ALTech) Wooshin Kang | File Added: aux_4ch_selection.txt | |
| 2020-12-08 16:56 | (ALTech) Wooshin Kang | Note Added: 0005351 | |
| 2020-12-09 09:29 |
|
File Added: property_overwrite_explain.pptx | |
| 2020-12-09 09:29 |
|
Note Added: 0005364 | |
| 2020-12-09 13:10 | (ALTech) Wooshin Kang | File Added: property_overwrite_explain_skt.pptx | |
| 2020-12-09 13:10 | (ALTech) Wooshin Kang | Note Added: 0005373 | |
| 2020-12-09 20:42 |
|
File Added: property_usage_more_examples.pptx | |
| 2020-12-09 20:42 |
|
Note Added: 0005394 | |
| 2020-12-11 21:44 | (ALTech) Wooshin Kang | Note Added: 0005429 | |
| 2020-12-15 11:53 |
|
Note Added: 0005463 | |
| 2020-12-17 18:25 | (ALTech) Wooshin Kang | Note Added: 0005507 | |
| 2020-12-17 19:01 |
|
Note Added: 0005508 | |
| 2020-12-17 21:24 |
|
Note Added: 0005512 | |
| 2020-12-23 17:23 | (ALTech) Wooshin Kang | Note Added: 0005585 | |
| 2020-12-28 09:08 |
|
Note Added: 0005621 | |
| 2020-12-28 10:44 | (SW) Jacky Chiang | Note Added: 0005626 | |
| 2020-12-28 10:58 | (ALTech) Wooshin Kang | Note Added: 0005627 | |
| 2021-01-08 18:48 | (ALTech) Wooshin Kang | Note Added: 0005767 | |
| 2021-01-22 11:50 | (SW) Jacky Chiang | Note Added: 0005932 | |
| 2021-01-22 11:50 | (SW) Jacky Chiang | Issue Monitored: (HW) Sean Chiang | |
| 2021-01-22 12:33 | (SW) Jacky Chiang | Assigned To | (SW) River Wong => (HW) Sean Chiang |
| 2021-01-22 12:35 | (SW) Jacky Chiang | Issue Monitored: (HW) Tom Lee | |
| 2021-01-26 10:21 | (ALTech) Wooshin Kang | Note Added: 0005944 | |
| 2021-01-27 12:02 | (HW) Sean Chiang | Note Added: 0005966 | |
| 2021-01-27 12:39 | (ALTech) Wooshin Kang | Note Added: 0005967 | |
| 2021-01-27 12:40 | (ALTech) Wooshin Kang | Assigned To | (HW) Sean Chiang => (SW) Sam Yang |
| 2021-01-27 17:59 | (SW) Sam Yang | Note Added: 0005972 | |
| 2021-01-27 18:00 | (SW) Sam Yang | Note Edited: 0005972 | |
| 2021-01-27 18:01 | (SW) Sam Yang | Note Edited: 0005972 | |
| 2021-01-27 20:00 | (ALTech) Wooshin Kang | Note Added: 0005973 | |
| 2021-02-02 17:57 | (SW) Sam Yang | Assigned To | (SW) Sam Yang => (ALTech) Wooshin Kang |
| 2021-02-02 17:57 | (SW) Sam Yang | Status | assigned => feedback |
| 2021-02-02 17:57 | (SW) Sam Yang | Note Added: 0006009 | |
| 2021-02-02 17:57 | (SW) Sam Yang | Issue Monitored: (SW) Sam Yang | |
| 2021-02-02 22:12 | (ALTech) Wooshin Kang | Note Added: 0006020 | |
| 2021-02-02 22:13 | (ALTech) Wooshin Kang | Assigned To | (ALTech) Wooshin Kang => (ALTech) Lonnie Kim |
| 2021-02-02 22:14 | (ALTech) Wooshin Kang | Note Edited: 0006020 | |
| 2021-02-05 13:29 | (ALTech) Wooshin Kang | Note Added: 0006043 | |
| 2021-02-08 19:05 | (ALTech) Wooshin Kang | Assigned To | (ALTech) Lonnie Kim => (SW) Sam Yang |
| 2021-02-09 14:47 | (SW) Sam Yang | Note Added: 0006066 | |
| 2021-02-09 14:49 | (SW) Sam Yang | Assigned To | (SW) Sam Yang => (ALTech) Wooshin Kang |
| 2021-03-03 12:35 |
|
Status | feedback => closed |
| 2021-03-03 12:35 |
|
Resolution | open => fixed |